Cocktail Help Reference
CountAsync Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > Repository<T> Class : CountAsync Method



predicate
Optional predicate to filter the entities
onSuccess
Optional callback to be called when the count was successful.
onFail
Optional callback to be called when the count failed.

Glossary Item Box

Returns the number of entities.

Syntax

Visual Basic (Declaration) 
Public Function CountAsync( _
   Optional ByVal predicate As Expression(Of Func(Of T,Boolean)), _
   Optional ByVal onSuccess As Action(Of Integer), _
   Optional ByVal onFail As Action(Of Exception) _
) As OperationResult(Of Integer)
Visual Basic (Usage)Copy Code
Dim instance As Repository(Of T)
Dim predicate As Expression(Of Func(Of T,Boolean))
Dim onSuccess As Action(Of Integer)
Dim onFail As Action(Of Exception)
Dim value As OperationResult(Of Integer)
 
value = instance.CountAsync(predicate, onSuccess, onFail)

Parameters

predicate
Optional predicate to filter the entities
onSuccess
Optional callback to be called when the count was successful.
onFail
Optional callback to be called when the count failed.

Return Value

Asynchronous operation result.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.